-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider: start log poller in tests #11336
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
@@ -660,6 +653,7 @@ func setupDependencies(t *testing.T, db *sqlx.DB, backend *backends.SimulatedBac | |||
pollerLggr.SetLogLevel(zapcore.WarnLevel) | |||
lorm := logpoller.NewORM(big.NewInt(1337), db, pollerLggr, pgtest.NewQConfig(false)) | |||
lp := logpoller.NewLogPoller(lorm, ethClient, pollerLggr, 100*time.Millisecond, false, 1, 2, 2, 1000) | |||
require.NoError(t, lp.Start(testutils.Context(t))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of the tests calling this setupDependencies
helper had a running log poller. Was that intentional?
@@ -534,7 +527,7 @@ func collectPayloads(ctx context.Context, t *testing.T, logProvider logprovider. | |||
for ctx.Err() == nil && len(allPayloads) < n && rounds > 0 { | |||
logs, err := logProvider.GetLatestPayloads(ctx) | |||
require.NoError(t, err) | |||
require.LessOrEqual(t, len(logs), logprovider.AllowedLogsPerUpkeep, "failed to get all logs") | |||
require.LessOrEqual(t, len(logs), logprovider.AllowedLogsPerUpkeep) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where TestIntegration_LogEventProvider
fails. Is this a per-round assumption? Meaning if this loop went fast enough, then the test would pass?
if err := logProvider.Start(ctx); err != nil { | ||
t.Logf("error starting log provider: %s", err) | ||
t.Fail() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These don't need to be called from separate goroutines, and it was actually a problem since the call to Fail
could race with the end of the test.
2cef51d
to
d0a87f4
Compare
821bb80
to
3713078
Compare
SonarQube Quality Gate 0 Bugs No Coverage information |
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
3713078
to
8fa0734
Compare
SonarQube Quality Gate 0 Bugs No Coverage information |
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Another PR exposed that
TestIntegration_LogEventProvider
was not starting its log poller instance. However, with the log poller actuallyStart
ed and running,TestIntegration_LogEventProvider
does not pass. It seems like there is a timing assumption baked in. Should it pass? Or does it depend on the log poller not running? If so, that is a bit unusual, since we don't normally interact with unstarted services.